package priv.conceit.sc.hoxton.file.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;

/**
 * minio 自动装配 对应类
 *
 * @author Conceit
 * @since 1.0.0, 2020/9/28
 */
@RefreshScope
@ConfigurationProperties(MinioProperties.FULL_PREFIX)
@Data
public class MinioProperties {

	public static final String PREFIX = "minio";
	public static final String FULL_PREFIX = FileProperties.PREFIX+".source."+PREFIX;

	/**
	 * 桶名
	 */
	private String bucketName;
	/**
	 * 路径分隔符
	 */
	private String pathSeparator;

	/**
	 * Request endpoint. Endpoint is an URL, domain name, IPv4 or IPv6 address.<pre>
	 *              Valid endpoints:
	 *              * https://s3.amazonaws.com
	 *              * https://s3.amazonaws.com/
	 *              * https://play.min.io:9000
	 *              * http://play.min.io:9010/
	 *              * localhost
	 *              * localhost.localdomain
	 *              * play.min.io
	 *              * 127.0.0.1
	 *              * 192.168.1.60
	 *              * ::1</pre>
	 */
	private String endpoint;
	
	/** 
	 * 如果使用该值 则链接uri为endpoint:{port}
	 */
	private int port=-1;

	/**
	 * 账号
	 */
	private String accessKey;
	/**
	 * 密钥
	 */
	private String secretKey;

	/**
	 * If true, access endpoint using HTTPS else access it using HTTP.
	 */
	private boolean secure;


}
